package com.example.service1.controller;

import com.example.service1.service.RemoteService1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 服务1的controller
 */
@RestController
public class Service1Controller {

    @Autowired
    private RemoteService1 remoteService1;

    //用于测试
    @RequestMapping("s1")
    public String s1() {
        return "这是服务1的测试语句";
    }

    //调用服务2
    @RequestMapping("calls2")
    public String calls2() {
        return remoteService1.s2();
    }

}
